package com.atstudy.etd;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2022/12/15 15:48
 * @copyright: 博为峰
 */
public class Sub extends Base {
    public String name;
    public static int age;

    public Sub() {
        //隐式语句 super();
        super();//调用父类无参构造方法
        System.out.println("Sub()");
    }

    public Sub(String name) {
        //隐式语句 super();
        this();//调本来中无参构造方法
//        super(name);//调父类中一个参数构造方法
        this.name = name;
    }

    public void m1() {
        super.m1();//调用父类方法
        System.out.println("Sub m1()" + this.name + "," + super.name);
    }
}
